const testData2 = [{
    "key": "1403448",
    "value": "金臣颐墅",
    "avgPrice": "75000",
    "lat": "31.146820",
    "lon": "121.224247"
}, {
    "key": "1405559",
    "value": "英庭名墅",
    "avgPrice": "74000",
    "lat": "31.171667",
    "lon": "121.326578"
}, {
    "key": "1405535",
    "value": "万科海上传奇",
    "avgPrice": "19000",
    "lat": "31.187369",
    "lon": "120.967969"
}, {
    "key": "1405541",
    "value": "富力湾别墅",
    "avgPrice": "13000",
    "lat": "31.175345",
    "lon": "120.998418"
}, {
    "key": "152847",
    "value": "宝业爱多邦",
    "avgPrice": "39000",
    "lat": "31.149842",
    "lon": "121.161466"
}, {
    "key": "1405549",
    "value": "时代御湖",
    "avgPrice": "18000",
    "lat": "31.194482",
    "lon": "120.971802"
}, {
    "key": "62663",
    "value": "高尚领域",
    "avgPrice": "90000",
    "lat": "31.261247",
    "lon": "121.414918"
}, {
    "key": "123338",
    "value": "金臣别墅",
    "avgPrice": "150000",
    "lat": "31.210394",
    "lon": "121.278620"
},
{
    "key": "1384176",
    "value": "森茂箐英公寓",
    "avgPrice": "15000",
    "lat": "31.479825",
    "lon": "121.103325"
},
{
    "key": "144693",
    "value": "朗诗人民路8号",
    "avgPrice": "37000",
    "lat": "31.510854",
    "lon": "120.916697"
},
{
    "key": "1384186",
    "value": "森茂汽车城",
    "avgPrice": "15000",
    "lat": "31.482659",
    "lon": "121.100916"
},
{ key: "146874", value: "昆城景苑", avgPrice: "19500", lat: "31.371918", lon: "120.959923" },
{ key: "639393", value: "万科未来之城", avgPrice: "15000", lat: "31.339095", lon: "120.869568" },
{ key: "172900", value: "大成莲创", avgPrice: "12000", lat: "31.345858", lon: "120.954633" },
{ key: "1405057", value: "象屿都城怡园", avgPrice: "22000", lat: "31.285241", lon: "121.076961" },
{ key: "1096429", value: "象屿·西郊御府", avgPrice: "20500", lat: "31.302503", lon: "121.144439" },
{ key: "1322531", value: "光合工社", avgPrice: "15500", lat: "31.295984", lon: "121.126894" },
{ key: "1405041", value: "象屿德馨嘉苑", avgPrice: "20000", lat: "31.298566", lon: "121.099450" },
{ key: "639393", value: "万科未来之城", avgPrice: "15000", lat: "31.339095", lon: "120.869568" },
{ key: "172900", value: "大成莲创", avgPrice: "12000", lat: "31.345858", lon: "120.954633" }
];

const testData1 = [
    { "key": "10425", "value": "上海周边", "count": 11, "lat": 30.791857, "lon": 119.892872 },
    { "key": "59", "value": "青浦区", "count": 5, "lat": 31.156432, "lon": 121.130729 },
    { "key": "55", "value": "嘉定区", "count": 4, "lat": 31.381522, "lon": 121.271965 },
    { "key": "49", "value": "普陀区", "count": 1, "lat": 31.255354, "lon": 121.402091 },
    { "key": "53", "value": "闵行区", "count": 1, "lat": 31.118541, "lon": 121.387442 },
    { "key": "56", "value": "浦东新区", "count": 1, "lat": 31.227774, "lon": 121.550831 },
    { "key": "57", "value": "金山区", "count": 1, "lat": 30.747943, "lon": 121.348932 },
    { "key": "58", "value": "松江区", "count": 1, "lat": 31.038284, "lon": 121.234222 },
    { "key": "777", "value": "昆山市", "count": 23, "lat": 31.391762, "lon": 120.98719 },
    { "key": "778", "value": "太仓市", "count": 10, "lat": 31.463419, "lon": 121.137149 },
    { "key": "4598", "value": "高新区", "count": 10, "lat": 31.335338, "lon": 120.440813 },
    { "key": "780", "value": "吴中区", "count": 9, "lat": 31.269146, "lon": 120.638818 },
    { "key": "782", "value": "张家港市", "count": 9, "lat": 31.881324, "lon": 120.562534 },
    { "key": "781", "value": "相城区", "count": 8, "lat": 31.374873, "lon": 120.64919 },
    { "key": "779", "value": "吴江区", "count": 7, "lat": 31.144422, "lon": 120.651728 },
    { "key": "4597", "value": "园区", "count": 7, "lat": 31.204549, "lon": 120.816246 },
    { "key": "4638", "value": "姑苏区", "count": 4, "lat": 31.341872, "lon": 120.623826 }
];

function search(param) {
    const { minLon, maxLon, minLat, maxLat } = param;
    return (param.lv > 0 ? testData2 : testData1).filter(v => {
        let lat = Number(v["lat"]);
        let lon = Number(v["lon"]);
        return minLon <= lon && maxLon >= lon && minLat <= lat && maxLat >= lat;
    })
}